package de.dailab.graphworld.ontology;

import de.dailab.graphworld.bean.utils.BeanUtils;
import java.util.List;

/**
 * The proposal message in the conract net protocol as required in the home
 * assignment.
 *
 * @author Kseniya
 */
public class Proposal extends Reply {

    private Integer freeCapacity;
    private List<Edge> distance;

    public Proposal(Task task, Integer freeCapacity, List<Edge> distance) {
        super(task, BeanUtils.selectProposalType(freeCapacity));
        this.freeCapacity = freeCapacity;
        this.distance = distance;
    }

    /**
     * Get the value of freeCapacity
     *
     * @return the value of freeCapacity
     */
    public Integer getFreeCapacity() {
        return freeCapacity;
    }

    /**
     * Set the value of freeCapacity
     *
     * @param freeCapacity new value of freeCapacity
     */
    public void setFreeCapacity(Integer freeCapacity) {
        this.freeCapacity = freeCapacity;
    }

    /**
     * Get the value of distance
     *
     * @return the value of distance
     */
    public List<Edge> getDistance() {
        return distance;
    }

    /**
     * Set the value of distance
     *
     * @param distance new value of distance
     */
    public void setDistance(List<Edge> distance) {
        this.distance = distance;
    }

    @Override
    public String toString() {
        return "proposal [" + getType() + ", capacity " + getFreeCapacity() + ", distance " + getDistance().size() + ']';
    }
}
